package com.farmer.mapper;

//import com.farmer.domain.Menupojo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.farmer.pojo.Menu;
import com.farmer.pojo.TreeResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 86183
 * @description 针对表【menu】的数据库操作Mapper
 * @createDate 2024-04-23 20:28:45
 * @Entity com.farmer.domain.Menupojo
 */
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
////根据角色id和上级菜单的id获取子菜单信息
//    @Select("select  * from menu where mid in(select min from r_menu where rid=#{rid}) and parentid = #{pid}")
//    List<Menu> selMenuInfoByRidPidMapper(@Param("rid") Integer rid, @Param("pid") String pid);

    void deleteRoleMenus(@Param("roleId") Integer roleId);

    void insertRoleMenus(@Param("roleId") Integer roleId, @Param("menuIds") List<Integer> menuIds);

    List<Menu> selectMenuListByUserId(Long userId);

    void deleteMenuRoles(@Param("menuId") Integer menuId);
}




